home *** CD-ROM | disk | FTP | other *** search
- /////////////////////////////////////////////////////////////////////////////// //
- // $Id: BasicDeviceRegistry.hxx,v 1.1 1994/02/18 19:48:54 bmott Exp $
- /////////////////////////////////////////////////////////////////////////////// //
- // BasicDeviceRegistry.hxx
- //
- // This abstract base class is used to derive a class that maintains a list
- // of al the device in the simulator and allows them to be created.
- //
- //
- // BSVC "A Microprocessor Simulation Framework"
- // Copyright (c) 1993
- // By: Bradford W. Mott
- // October 30,1993
- //
- ///////////////////////////////////////////////////////////////////////////////
- // $Log: BasicDeviceRegistry.hxx,v $
- // Revision 1.1 1994/02/18 19:48:54 bmott
- // Initial revision
- //
- ///////////////////////////////////////////////////////////////////////////////
-
- #ifndef BASICDEVICEREGISTRY_HXX
- #define BASICDEVICEREGISTRY_HXX
-
- #include "String.h"
-
- class BasicCPU;
- class BasicDevice;
-
- ///////////////////////////////////////////////////////////////////////////////
- // Device Information Type
- ///////////////////////////////////////////////////////////////////////////////
- typedef struct {
- const char *name; // The name of the device ("RAM","m6850",etc)
- const char *description; // A short description of the device
- const char *script; // UI script to get the device attachment args
- } DeviceInformation;
-
- ///////////////////////////////////////////////////////////////////////////////
- // BasicDeviceRegistry class declaration
- ///////////////////////////////////////////////////////////////////////////////
- class BasicDeviceRegistry {
- private:
- // List of devices in the simulator
- const DeviceInformation *devices;
-
- // Number of devices in the simulator
- const int number_of_devices;
-
- public:
- BasicDeviceRegistry(const DeviceInformation *devs, int num)
- : devices(devs),
- number_of_devices(num)
- {};
-
- // Return the number of devices
- inline int NumberOfDevices()
- { return(number_of_devices); }
-
- // Get the device information with the given index (return 1=OK,0=ERROR)
- int Information(int index, DeviceInformation& information);
-
- // Create a device with the given name (return 1=OK,0=ERROR)
- virtual int Create(String& name, String& args, BasicCPU* cpu,
- BasicDevice* &device)=0;
- };
- #endif
-
-